package com.hjb.springbootdemo.sigle;

//双重检查
public class Signleton3 {

    private volatile static Signleton3 signleton3;

    private Signleton3() {
    }

    public static Signleton3 getInstance() {
        if (signleton3 == null) {
            synchronized (Signleton3.class) {
                if (signleton3 == null) {
                    signleton3 = new Signleton3();
                }
            }
        }
        return signleton3;
    }
}
